package com.wyix.exception;

/**
 * 权限认证异常基类
 */
public class AuthException extends RuntimeException {

    private int code;

    public AuthException(String message) {
        super(message);
        this.code = 401; // 默认401未授权
    }

    public AuthException(int code, String message) {
        super(message);
        this.code = code;
    }

    public AuthException(String message, Throwable cause) {
        super(message, cause);
        this.code = 401;
    }

    public int getCode() {
        return code;
    }
}
